<template>
  <div>
      <p>子组件库存: {{ value }}</p>
      <button @click="addFn">增加+1</button>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  methods: {
    addFn () {
      this.$emit('input', this.value + 1)
    }
  }
}
</script>
